import request from '@/utils/request2'

export function page(data) {
  return request({
    url: '/qt-plan/page',
    method: 'get',
    params: data
  })
}

export function removes(data) {
  return request({
    url: `/qt-plan/dels?${data}`,
    method: 'get'
  })
}

export function addOrUpdate(data) {
  return request({
    url: '/qt-plan',
    method: 'post',
    data
  })
}

export function getOne(id) {
  return request({
    url: `/qt-plan/one/${id}`,
    method: 'get'
  })
}

export function detail(id) {
  return request({
    url: `/qt-plan-detail/${id}`,
    method: 'get'
  })
}

export function detailUpdate(data) {
  return request({
    url: `/qt-plan-detail`,
    method: 'post',
    data
  })
}

export function reportPage(data, planId) {
  return request({
    url: `/plan-history-report/page/${planId}`,
    method: 'get',
    params: data
  })
}

export function reportDetail(reportId) {
  return request({
    url: `/test-result/${reportId}`,
    method: 'get'
  })
}

export function run(planId) {
  return request({
    url: `/qt-plan/run/${planId}`,
    method: 'get'
  })
}

